#pragma once
 
#include "types.h"
 
typedef struct
{
    FourCC id; // 区块类型
    DWord size; // 区块大小(不包括id和size字段的大小)
} RIFFChunkHeader;
 
typedef struct
{
    FourCC id; // 必须是 "RIFF"
    DWord size; // 文件大小(字节数)-8
    FourCC type; // 必须是 "WAVE"
} RIFFHeader;
 
 
/* 下面这些格式字段的具体含义上篇文章都有说明 */
 
typedef struct
{
    Word FormatTag;
    Word Channels;
    DWord SampleRate;
    DWord BytesRate;
    Word BlockAlign;
    Word BitsPerSample;
} WaveFormat;
 
typedef struct
{
    Word FormatTag;
    Word Channels;
    DWord SampleRate;
    DWord BytesRate;
    Word BlockAlign;
    Word BitsPerSample;
    Word ExSize;
} WaveFormatEx;
 
typedef struct
{
    Word FormatTag;
    Word Channels;
    DWord SampleRate;
    DWord BytesRate;
    Word BlockAlign;
    Word BitsPerSample;
    Word ExSize;
    Word ValidBitsPerSample;
    DWord ChannelMask;
    Guid SubFormat;
} WaveFormatExtensible;
 